package entity;

import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {
    private Integer id;
    private String username;
    private String password;
    private String phone;
    private Date registDate;
    private String[] hobbies;

    public static final String HOBBIES_SPLIT=",";

    public User() {
    }


    public String getHob(){
        if(hobbies!=null){
            return String.join(HOBBIES_SPLIT,hobbies);
        }
        return null;
    }


    public void setHob(String hob){
        if(hob!=null){
            hobbies=hob.split(HOBBIES_SPLIT);
        }
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public Date getRegistDate() {
        return registDate;
    }

    public void setRegistDate(Date registDate) {
        this.registDate = registDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
